﻿/**********************************************************************
 * @file   FITKRadiossAdaptorSolverParam.h
 * @brief  Radioss适配器 用于读取0001.rad文件和写出0001.rad文件
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2025-09-10
 *********************************************************************/
#ifndef _FITKRADIOSSADAPTORSOLVERPARAM_H_
#define _FITKRADIOSSADAPTORSOLVERPARAM_H_
#include "FITKRadiossRadIOAPI.h"
#include "FITKRadiossAbstractAdaptor.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"

namespace Radioss
{
    class FITKRadiossCase;
    class FITKRadiossSolution;
 
    /**
     * @brief  Radioss RAD 读写适配器
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date   2025-07-02
     */
    class FITKRadiossAdaptorSolverParam : public FITKRadiossAbstractAdaptor
    {
    public:
        explicit FITKRadiossAdaptorSolverParam() = default;
        ~FITKRadiossAdaptorSolverParam() = default;
        /**
         * @brief    获取适配器数据类型名
         * @return   QString 适配器数据类型名
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-07-02
         */
        QString getAdaptorClass() override;
        /**
         * @brief    适配器读取
         * @return   bool true成功，false失败
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-07-02
         */
        bool adaptR() override;
        /**
         * @brief    适配器写出
         * @return   bool true成功，false失败
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-07-02
         */
        bool adaptW() override;

    private:
        /**
         * @brief    读取打印配置
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-07-08
         */
        bool readPrint();
        /**
         * @brief    写出打印配置
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-10
         */
        bool writePrint();
        /**
         * @brief    读取运行配置
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-07-08
         */
        bool readRun();
        /**
         * @brief    写出运行配置
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-10
         */
        bool writeRun();
        /**
         * @brief    读取并行配置
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-11
         */
        bool readParallel();
        /**
         * @brief    写出并行配置
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-11
         */
        bool writeParallel();
        /**
         * @brief    读取停止控制
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-12
         */
        bool readStopControl();
        /**
         * @brief    写出停止控制
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-12
         */
        bool writeStopControl();

        /**
         * @brief    读取动画参数
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-11
         */
        bool readAnimationParam();
        /**
         * @brief    写出动画参数
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-11
         */
        bool writeAnimationParam();
        /**
         * @brief    读取点时间步参数
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-12
         */
        bool readNodeTimeParam();
        /**
         * @brief    写出点时间步参数
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-12
         */
        bool writeNodeTimeParam();

        /**
         * @brief    读取单元的时间步
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-11
         */
        bool readElemTimeParam();
        /**
         * @brief    写出单元的时间步
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-11
         */
        bool writeElemTimeParam();
        /**
         * @brief    读取收敛参数
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-12
         */
        bool readConvergenceCriteriaParam();
        /**
         * @brief    写出收敛参数
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-09-12
         */
        bool writeConvergenceCriteriaParam();

    private:
        /**
         * @brief  求解参数数据
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-07-08
         */
        FITKRadiossSolution* _solutionData{};
    };
    /**
     * @brief 注册适配器
     * @date   2025-07-07
     */
    Register2FITKIOAdaptorFactory(rad, Radioss::FITKRadiossSolution, FITKRadiossAdaptorSolverParam);
    RegRadiossRadAdaptor(/PRINT, FITKRadiossAdaptorSolverParam);
    RegRadiossRadAdaptor(/RUN, FITKRadiossAdaptorSolverParam, 1);
    RegRadiossRadAdaptor(/ANIM, FITKRadiossAdaptorSolverParam, 2);
    RegRadiossRadAdaptor(/PARITH, FITKRadiossAdaptorSolverParam, 3);
    RegRadiossRadAdaptor(/DT, FITKRadiossAdaptorSolverParam, 4);
    RegRadiossRadAdaptor(/DT1, FITKRadiossAdaptorSolverParam, 5);
    RegRadiossRadAdaptor(/STOP, FITKRadiossAdaptorSolverParam, 6);
}
#endif // !_FITKRADIOSSADAPTORCASE_H_